# -*- coding: utf-8 -*-
import scrapy


class JiandanSpider(scrapy.Spider):
    name = 'jiandan'
    allowed_domains = ['jandan.net']
    start_urls = ['http://jandan.net/']

    def parse(self, response):
        items = []
        for next_div in response.xpath('//div[@class="post f list-post"]'):
            item = next_div.xpath('div[@class="indexs"]')[0]
            item = item.xpath('h2/a/text()').extract()
            print(item)
            print('--------------------------------------------')
            # // *[ @ id = "content"] / div[1] / div[2] / h2 / a
